1. Field of the Invention
This invention relates to a method and apparatus for switching messages from a primary message channel to a secondary message channel in a message queuing system when the primary message channel is out of service.
2. Description of the Related Art
Message queuing is a common form of interprocess communication (IPC) in information handling systems. In its basic form, a first process (typically a user application) places a message on a defined queue by issuing a defined command (such as MQPUT in an IBM MQSeries message queuing environment), while a second process retrieves the message from the queue by issuing another defined command (such as MQGET in the same MQSeries environment).
Message queues may be either local queues on a local system or remote queues on a remote system. When a local application sends a message to a remote queue in an MQSeries environment, the local queue manager receiving the MQPUT command puts the message on a specially defined local queue called a transmission queue. A sender channel on the local system forwards any messages in the transmission queue via a network to a receiver channel on the remote system. (The sender and receiver channels are generically referred to herein as message channels.) The receiver channel in turn forwards the messages to the remote queue that was the intended recipient. MQSeries message channels are conventionally implemented using standard network protocols such as TCP/IP or SNA LU 6.2. Communication networks, however, are notoriously susceptible to failures and outages, which in turn may cause an MQSeries message channel to become unavailable to a local system. When that happens, messages on the local system which are destined for other systems using the unavailable message channel for transport can no longer be sent. This presents a serious problem for a high-performance transaction processor, because the messages on the local system use system resources which cannot be released until the messages are sent. Human intervention is typically required to handle this problem by trying to resolve the network problem.
Very often a network problem is not easily resolvable, and a message channel outage can eventually cause a message queuing system to become unavailable, due to the resource tieup. Thus, system availability and reliability are greatly reduced, and human intervention is required to remediate the situation.
In general, the present invention relates to a method and apparatus for switching messages from a primary message channel to a secondary message channel in a message queuing system in which messages are placed in a first transmission queue of a local system for transmission to a remote system via the primary message channel. In accordance with the invention, a determination is made of whether there has been an apparent failure in the primary message channel. Such determination is preferably made by determining that a high water mark has been reached in the first transmission queue.
In response to determining such an apparent failure in the primary message channel, a determination is made of whether the secondary message channel is associated with the first transmission queue. If the secondary message channel is associated with the first transmission queue, then the secondary message channel is activated to serve the first transmission queue. If, on the other hand, the secondary message channel is associated instead with a second transmission queue, the messages already in the first queue are transferred to the second queue and any new messages intended for the first queue are redirected to the second queue.
The present invention allows messages to be switched non-disruptively from a failing first message channel to a second message channel without requiring operator invention.